package com.ws.hzuoj.admin.system.dictionary.service.impl;

import com.ws.common.easyui.util.Page;
import com.github.pagehelper.PageHelper;
import com.ws.hzuoj.admin.system.dictionary.dao.DictionaryEntityMapper;
import com.ws.hzuoj.admin.system.dictionary.entity.DictionaryEntity;
import com.ws.hzuoj.admin.system.dictionary.service.IDictionaryEntityService;
import com.ws.common.base.service.Impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictionaryEntityServiceImpl extends BaseServiceImpl<DictionaryEntity> implements IDictionaryEntityService{

	@Autowired
	DictionaryEntityMapper dictionaryEntityMapper;

	@Override
	public List<DictionaryEntity> list(DictionaryEntity params) {
		return dictionaryEntityMapper.list(params);
	}

	@Override
	public List<DictionaryEntity> list(DictionaryEntity params, Page page) {
		PageHelper.startPage(page.getPage(),page.getRows(),page.getSortOrder());
		return dictionaryEntityMapper.list(params);
	}

	@Override
	public Integer save(DictionaryEntity dictionaryEntity) {
		return this.insertOrUpdate(dictionaryEntity);
	}
}
